package com.demo.io;
import java.io.FileInputStream;
import java.io.IOException;

public class FileRead2 {
    public static void main(String[] args) throws IOException {
        // 读取文件流
        // 输出流的操作步骤
        // 1.创建输入流
        FileInputStream fs = new FileInputStream("db.sql");
        // 2.读取
        byte[] bytes = new byte[96]; // 每次读96字节
        int readLength;
        StringBuffer sb = new StringBuffer();
        while((readLength = fs.read(bytes)) != -1){
            sb.append(new String(bytes,0,readLength));
        }
        // 3.关闭流
        fs.close();
        System.out.println(sb);

    }
}
